import request from '@/config/axios'

export interface ReservationVO {
  id: number
  tableId: number
  customerName: string
  contactNumber: string
  reservationTime: Date
  numberOfGuests: number
  reservationStatus: number
  paymentStatus: number
  notes: string
}



// 查询预约记录列表
export const getReservationPage = async (params) => {

  return await request.get({ url: `/tables/reservation/page`, params })
}

// 查询预约记录详情
export const getReservation = async (id: number) => {
  return await request.get({ url: `/tables/reservation/get?id=` + id })
}

// 新增预约记录
export const createReservation = async (data: ReservationVO) => {
  return await request.post({ url: `/tables/reservation/create`, data })
}

// 修改预约记录
export const updateReservation = async (data: ReservationVO) => {
  return await request.put({ url: `/tables/reservation/update`, data })
}

// 删除预约记录
export const deleteReservation = async (id: number) => {
  return await request.delete({ url: `/tables/reservation/delete?id=` + id })
}

// 导出预约记录 Excel
export const exportReservation = async (params) => {
  return await request.download({ url: `/tables/reservation/export-excel`, params })
}
